home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / stdlib / RCS / Mem_Bin.c,v < prev    next >
Encoding:
Text File  |  1991-12-03  |  2.2 KB  |  121 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  sprited:1.2.1;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     88.07.25.14.19.20;  author ouster;  state Exp;
  11. branches 1.2.1.1;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     88.05.20.15.49.19;  author ouster;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19. 1.2.1.1
  20. date     91.12.02.20.37.08;  author kupfer;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24.  
  25. desc
  26. @@
  27.  
  28.  
  29. 1.2
  30. log
  31. @Lint.
  32. @
  33. text
  34. @/* 
  35.  * Mem_Bin.c --
  36.  *
  37.  *    Source code for the "Mem_Bin" library procedure.  See memInt.h
  38.  *    for overall information about how the allocator works.
  39.  *
  40.  * Copyright 1985, 1988 Regents of the University of California
  41.  * Permission to use, copy, modify, and distribute this
  42.  * software and its documentation for any purpose and without
  43.  * fee is hereby granted, provided that the above copyright
  44.  * notice appear in all copies.  The University of California
  45.  * makes no representations about the suitability of this
  46.  * software for any purpose.  It is provided "as is" without
  47.  * express or implied warranty.
  48.  */
  49.  
  50. #ifndef lint
  51. static char rcsid[] = "$Header: Mem_Bin.c,v 1.1 88/05/20 15:49:19 ouster Exp $ SPRITE (Berkeley)";
  52. #endif not lint
  53.  
  54. #include "memInt.h"
  55.  
  56. /*
  57.  * ----------------------------------------------------------------------------
  58.  *
  59.  * Mem_Bin --
  60.  *
  61.  *    Make objects of the given size be binned.
  62.  *
  63.  * Results:
  64.  *    None.
  65.  *
  66.  * Side effects:
  67.  *    The bin corresponding to blocks of the given size is initialized.
  68.  *
  69.  * ----------------------------------------------------------------------------
  70.  */
  71. ENTRY void
  72. Mem_Bin(numBytes)
  73.     int    numBytes;
  74. {
  75.     int    index;
  76.  
  77.     LOCK_MONITOR;
  78.  
  79.     if (!memInitialized) {
  80.     MemInit();
  81.     } 
  82.     numBytes = BYTES_TO_BLOCKSIZE(numBytes);
  83.     if (numBytes > BIN_SIZE) {
  84.     UNLOCK_MONITOR;
  85.     return;
  86.     }
  87.     index = BLOCKSIZE_TO_INDEX(numBytes);
  88.     if (memFreeLists[index] == NOBIN) {
  89.     memFreeLists[index] = (Address) NULL;
  90.     }
  91.  
  92.     UNLOCK_MONITOR;
  93. }
  94. @
  95.  
  96.  
  97. 1.2.1.1
  98. log
  99. @Initial branch for Sprite server.
  100. @
  101. text
  102. @d18 1
  103. a18 1
  104. static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/Mem_Bin.c,v 1.2 88/07/25 14:19:20 ouster Exp $ SPRITE (Berkeley)";
  105. @
  106.  
  107.  
  108. 1.1
  109. log
  110. @Initial revision
  111. @
  112. text
  113. @d18 1
  114. a18 1
  115. static char rcsid[] = "$Header: proto.c,v 1.2 88/03/11 08:39:08 ouster Exp $ SPRITE (Berkeley)";
  116. d42 1
  117. a42 2
  118.     int    index, admin;
  119.     register Address blockPtr;
  120. @
  121.